package com.hades.xq.miaoshao.error;

public class BusinessException extends Exception implements CommonError {

    private CommonError mCommonError;

    //直接接受EmBusinessError的传参用于构建业务异常
    public BusinessException(CommonError commonError) {
        super();
        this.mCommonError = commonError;
    }

    public BusinessException(CommonError commonError, String errorMsg) {
        super();
        this.mCommonError = commonError;
        this.mCommonError.setErrorMsg(errorMsg);
    }


    @Override
    public int getErrorCode() {
        return this.mCommonError.getErrorCode();
    }

    @Override
    public String getErrirMsg() {
        return this.mCommonError.getErrirMsg();
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        this.mCommonError.setErrorMsg(errorMsg);
        return this;
    }
}
